#!/bin/bash


  PRG="/home/mark/temp/mark5"
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '/.*' > /dev/null; then
    PRG="$link"
    echo 'wa'
  else
  	echo `dirname "$PRG"`/"$link"
    PRG=`dirname "$PRG"`/"$link"
  fi

  echo $ls
  echo $link
  echo $PRG

